<template>
	<div id='Course' class=''>
		<div @click="goCourseBmDetail(item)" class="list" v-for="item in dataList" >
			<div class="list_img_f">
				<img class="list_img" :src="item.list_img" alt="" />
				<div v-if='item.enable==1' class="list_img_people">还剩<span>{{item.places}}</span>个名额</div>
			</div>
			<div class="title c_size_34_48 c_text_ellipsis_2">{{item.title}}</div>
			<div class="c_size_30_42">
				<span>开课时间：</span><span>{{item.open_time}}</span>
			</div>
			<div class="course_addr_f c_size_30_42">
				<div class="course_addr">
					<span>地点：</span><span>{{item.address}}</span>
				</div>
				<div v-if='item.enable==1' class="course_addr_label">{{bmStr}}</div>
				<div v-else class="course_addr_label" style="color: #999999;">已结束</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: 'Course',
		props: {
			dataList: {
				default:function(){
					return []
				},
			},
			bmStr:{
				default:'报名中'
			},
			urlName:{
				default:'courseBmDetail'
			}
		},
		components: {

		},
		data() {
			return {

			}
		},
		created() {},
		watch: {

		},
		computed: {

		},
		mounted() {

		},
		methods: {
			//去课程详情
			goCourseBmDetail(item){
				let query = {order_id:item.order_id};
				if(this.urlName=='courseBmDetail'){
					query = {aid:item.id}
				}
				this.$router.push({
					name:this.urlName,
					query:query
				})
			}
		}
	}
</script>

<style lang="scss">
	@import './Course.scss';
</style>